Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Initial work on OpenFX module support #1051

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joinlaw
Copy link
Contributor

@joinlaw joinlaw commented Nov 16, 2024

Since I reached presentable state I published this change so I can receive feedback from the community.

This video shows testing the module with the uk.co.thefoundry.OfxInvertExample openfx sample plugin:

openfxtest.mp4

Yes this implementation still lack many things such as opengl, draw suit (which is something the plugins could use for drawing vector graphics like post script or cairo), multi-threading, openfx logging extension and still many things ignored and implemented as dummy functions.

Also this is still under testing it crashes for my many times.

@ddennedy ddennedy marked this pull request as draft November 17, 2024 19:21
@ddennedy
Copy link
Member

I will require that you fix some bugs before you can submit new features. It is not fair to other developers if a person only does the more fun work of features but never helps fixing bugs.

@joinlaw
Copy link
Contributor Author

joinlaw commented Nov 20, 2024

I will require that you fix some bugs before you can submit new features. It is not fair to other developers if a person only does the more fun work of features but never helps fixing bugs.

That's fair. you have some bugs in mind? is it something related to my module (lv2, vst2) or in general?

Copy link
Contributor

@YakoYakoYokuYoku YakoYakoYokuYoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to address the elephant in the room, ... where did you get the OpenFX headers? Just want this to be clarified so then its upstream is pulled for changes.

filter_openfx.c
)

file(GLOB YML "*.yml")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather be explicit about the YAML files, because I think there won't be that many services here.


target_compile_options(mltopenfx PRIVATE ${MLT_COMPILE_OPTIONS})

target_link_libraries(mltopenfx PRIVATE mlt m)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes that every platform has libm though that might not be the case, just link it if it's needed.


static const char *getArchStr()
{
if(sizeof(void *) == 4) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that there's a precompiler definition out there that describes the architecture bits, look for it if there's one.

MltOfxHost.host = (OfxPropertySetHandle) mlt_properties_new ();
mltofx_init_host_properties (MltOfxHost.host);

char *dir, *openfx_path = getenv("OFX_PLUGIN_PATH");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant that you've thought ahead about multiple paths, though, is there a way to set a default?

de = readdir(d);
}

}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are mixing tabulation characters here, please run clang-format or ninja astyle.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have lots of places that are yet to be worked on, and that's okay. I mean, this PR is meant to be the starting point. Albeit, I'd do a pair of things, comment TODO where appropriate to let know why the feature is incomplete and split suites into their own files to organize code better.

propSetString ((OfxPropertySetHandle) clip_prop, kOfxImagePropField, 0, kOfxImageFieldNone); /* I'm not sure about this */

char *tstr = calloc(1, strlen ("Output") + 11);
sprintf (tstr, "%s%04d%04d", "Output", rand () % 9999, rand () % 9999); /* WIP: do something better */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a chance for collision if you use random numbers, but what about hashing? That's what Natron does.

(OfxPropertySetHandle) get_roi_out_args);
mltofx_log_status_code (status_code, kOfxImageEffectActionGetRegionsOfInterest);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, this should come after begin sequence render per the header declaration and what end by itself means.

Comment on lines +60 to +64
void
mltofx_set_source_clip_data (OfxPlugin *plugin, mlt_properties image_effect, uint8_t *image, int width, int height);

void
mltofx_set_output_clip_data (OfxPlugin *plugin, mlt_properties image_effect, uint8_t *image, int width, int height);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either name the first as mltofx_set_input_clip_data or the second as mltofx_set_destination_clip_data.


mltofx_log_status_code (status_code, kOfxImageEffectActionRender);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go after the next one per what's declared in the header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants